package cn.anecansaitin.jep.parser.ast.node.expression.literal;

import cn.anecansaitin.jep.TokenType;
import cn.anecansaitin.jep.types.TypeInfo;

public sealed class BooleanLiteral extends Literal permits FalseLiteral, TrueLiteral {
    private final boolean value;

    public BooleanLiteral(boolean value, int line, int column) {
        super(value ? TokenType.TRUE_LITERAL : TokenType.FALSE_LITERAL, TypeInfo.BOOLEAN, line, column);
        this.value = value;
    }

    public boolean value() {
        return value;
    }
}